let base = config.ip
let projectName = '/jx-attendance-reg'

import { get, post } from './http.js'

// 获取个人考勤统计详情类型
export const getListLeaveType = p => post(`${base}${projectName}/sa-statistics-overseer/listLeaveType`, p)
// 获取个人考勤统计详情类型
export const getListAllUserByAuthority = p =>
  post(`${base}${projectName}/sa-statistics-overseer/listAllUserByAuthority`, p)
// 出勤登记 ------------ 开始
// 获取用户登记手机号及编号
export const getRegInfo = p => post(`${base}${projectName}/sa-form/getRegInfo`, p)

/************************* 日常考勤-新 开始*************************/
// 获取科室
export const attendAllDepartment = p =>
  post(`${base}${projectName}/data-authority/selectAllDepartment`, p, {
    headers: {
      hideLoading: true,
    },
  })
// 获取科室下所有的人
export const attendAllPerson = p =>
  post(`${base}${projectName}/data-authority/selectAllUserByDepartment`, p, {
    headers: {
      hideLoading: true,
    },
  })

// 获取考勤表单类型列表
export const listAttendanceFormType = p => post(`${base}${projectName}/sa-form/listAttendanceFormType`, p)
// 获取表单请假类型列表
export const listAttendanceLeaveType = p => post(`${base}${projectName}/sa-form/listAttendanceLeaveType`, p)
// 录入考勤登记单信息
export const addAttendanceDaily = p => post(`${base}${projectName}/sa-form/addAttendanceDaily`, p)
// 获取考勤表单列表
export const listAttendanceDaily = p => post(`${base}${projectName}/sa-form/listAttendanceDaily`, p)
// 获取考勤表单详情
export const getAttendanceDailyInfo = p => post(`${base}${projectName}/sa-form/getAttendanceDailyInfo`, p)
// 获取考勤审批列表
export const listAttendanceApprove = p => post(`${base}${projectName}/sa-form/listAttendanceApprove`, p)
// 计算时间区间时长
export const getValidByTimeZone = p => post(`${base}${projectName}/sa-form/getValidByTimeZone`, p)
// 更新考勤表单状态-审批/撤销
export const updateAttendanceDailyStatus = p => post(`${base}${projectName}/sa-form/updateAttendanceDailyStatus`, p)
//获取关联请假单列表
export const listRelatedLeave = p => post(`${base}${projectName}/sa-form/listRelatedLeave`, p)
//更新考勤登记单信息
export const updateAttendanceDaily = p => post(`${base}${projectName}/sa-form/updateAttendanceDaily`, p)
//获取审批流程列表-流程图
export const getFlowApproveList = p => post(`${base}${projectName}/sa-form/getFlowApproveList`, p)

//获取右上角考勤规则和考勤标准
export const getAttendanceRoleAndStandard = p =>
  post(`${base}${projectName}/sa-statistics-overseer/getAttendanceRoleAndStandard`, p)
//获取个人月度考勤汇总
export const getAttendanceSumSelf = p => post(`${base}${projectName}/sa-statistics-overseer/getAttendanceSumSelf`, p)
//获取个人月度考勤明细
export const getAttendanceDetailSelf = p =>
  post(`${base}${projectName}/sa-statistics-overseer/getAttendanceDetailSelf`, p)
//获取个人考勤状态详情
export const getAttendanceStatusSelf = p =>
  post(`${base}${projectName}/sa-statistics-overseer/getAttendanceStatusSelf`, p)
//获取部门考勤统计汇总数目
export const getAttendanceSumOrg = p => post(`${base}${projectName}/sa-statistics-overseer/getAttendanceSumOrg`, p)
//获取部门考勤统计详情
export const getAttendanceStatusOrg = p =>
  post(`${base}${projectName}/sa-statistics-overseer/getAttendanceStatusOrg`, p)
//获取全局各部门每日出勤率和平均工时(APP)
export const getOrgAttendanceRate = p => post(`${base}${projectName}/sa-statistics-overseer/getOrgAttendanceRate`, p)
//获取部门考勤统计详情—(APP端，按人员和类型进行合并)
export const getAttendanceStatusOrgAPP = p =>
  post(`${base}${projectName}/sa-statistics-overseer/getAttendanceStatusOrgAPP`, p)

// 获取督查列表
export const getOverseerList = p => post(`${base}${projectName}/sa-statistics-overseer/getOverseerList`, p)
// 督查列表核查
export const checkOverseerStatus = p => post(`${base}${projectName}/sa-statistics-overseer/checkOverseerStatus`, p)
// 获取待核查未读数据列表
export const getOverseerNoReadList = p => post(`${base}${projectName}/sa-statistics-overseer/getOverseerNoReadList`, p)
// 更新脱岗和旷工记录的已读/未读状态
export const updateOverseerReadStatus = p =>
  post(`${base}${projectName}/sa-statistics-overseer/updateOverseerReadStatus`, p)

// list-获取统计汇总页年份和月份列表
export const getSearchTimeList = p => post(`${base}${projectName}/data-authority/getSearchTimeList`, p)

// list-获取统计汇总页查询类型列表
export const getTypeList = p => post(`${base}${projectName}/data-authority/getTypeList`, p)

// list-获取统计汇总页人员数据权限
export const getDataPermissions = p => post(`${base}${projectName}/data-authority/getDataPermissions`, p)

// list-获取部门考勤统计详情
export const getOrgStatisticsDetail = p =>
  post(`${base}${projectName}/sa-statistical-summary/getOrgStatisticsDetail`, p)

// list-获取个人月度考勤日历
export const getUserStatisticsCalendar = p =>
  post(`${base}${projectName}/sa-statistical-summary/getUserStatisticsCalendar`, p)

// list-获取部门考勤统计汇总数目
export const getOrgStatisticsSum = p => get(`${base}${projectName}/sa-statistical-summary/getOrgStatisticsSum`, p)

// list-获取个人考勤统计汇总数目
export const getUserStatisticsSum = p => get(`${base}${projectName}/sa-statistical-summary/getUserStatisticsSum`, p)

// list-获取个人考勤统计列表
export const getUserStatisticsDetail = p =>
  post(`${base}${projectName}/sa-statistical-summary/getUserStatisticsDetail`, p)

// list-获取部门考勤统计详情—(APP端)按人员和类型进行合并
export const getOrgStatisticsDetailApp = p =>
  post(`${base}${projectName}/sa-statistical-summary/getOrgStatisticsDetailApp`, p)

//local-list-获取旷工记录列表
export const getNeglectList = p => post(`${base}${projectName}/sa-statistical-summary/getNeglectList`, p)

//local-get-获取旷工记录详情
export const getNeglectRecordDetail = p => get(`${base}${projectName}/sa-statistical-summary/getNeglectRecordDetail`, p)

//local-add-新增/编辑旷工记录
export const addNeglectRecord = p => post(`${base}${projectName}/sa-statistical-summary/addNeglectRecord`, p)

//local-get-校验时间是否有重叠
export const checkIsOverlap = p => post(`${base}${projectName}/sa-statistical-summary/checkIsOverlap`, p)

//local-add-删除旷工记录
export const delNeglectRecord = p => get(`${base}${projectName}/sa-statistical-summary/delNeglectRecord`, p)

//local-list-获取旷工记录列表——APP
export const getNeglectListApp = p => post(`${base}${projectName}/sa-statistical-summary/getNeglectListApp`, p)

/************************* 日常考勤-新  开始*************************/
